/**
 * @file graph.h
 * @author 范文宇 (2643660853@qq.com)
 * @brief 
 * @version 1.0
 * @date 2022-10-21
 * 
 * @copyright Copyright (c) 2022
 * 
 */
#pragma once
#include <vector>
#include <string>
#include <iostream>
#include <opencv2/opencv.hpp>

class Graph
{
private:
	int __point_height;					 
	int __point_width;					 
	int __vertexNum;					 
	std::vector<int> __vertex;			 
	cv::Mat1d __edge;					 
	std::vector<cv::Point2i> __obstacle; 
	cv::Point2i __startingPoint;		 
	cv::Point2i __finishingPoint;		 

public:
	Graph(int point_width, int point_height,
			cv::Point2i startingPoint = cv::Point2i(0, 0), cv::Point2i finishingPoint = cv::Point2i(0, 0));
	~Graph() = default;

	void initEdge();
	
	void updateEdge(std::vector<cv::Point2i> &obstacles);
	
	inline int getPointH() { return __point_height; }
	
	inline int getPointW() { return __point_width; }
	
	inline std::vector<int> &getVertex() { return __vertex; }
	
	inline cv::Mat1d &getEdge() { return __edge; }

	inline void setObstacle(std::vector<cv::Point2i> &obstacle) { this->__obstacle = obstacle; }

	inline std::vector<cv::Point2i> &getObstacle() { return __obstacle; }

	inline void setStartingPoint(cv::Point2i startingPoint) { this->__startingPoint = startingPoint; }
	
	inline cv::Point2i getStartingPoint() { return __startingPoint; }
	
	inline void setFinishingPoint(cv::Point2i finishingPoint) { this->__finishingPoint = finishingPoint; }
	
	inline cv::Point2i getFinishingPoint() { return __finishingPoint; }
};